package com.example.shrimp.splach;

import com.example.common.entity.BaseEntity;
import com.example.common.mvvm.databus.LiveDataBus;
import com.example.common.mvvm.viewmodel.BaseViewModel;

import java.util.List;

public class SplashViewModel extends BaseViewModel<SplashRespository> {

    public LiveDataBus<String> dataBus=new LiveDataBus<>();

    @Override
    public void onResult(BaseEntity entity) {

    }

    @Override
    protected void initData() {
        new Thread(){
            @Override
            public void run() {
                super.run();
                for (int i =3 ; i >=0 ; i--) {
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    dataBus.postValue(""+i+"s");
                }
            }
        }.start();
    }
}
